package com.sample.transaction.seata;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;

@SpringBootApplication
@EnableFeignClients
@EnableDiscoveryClient(autoRegister = false)
public class BusinessApplication {

    public static void main(String[] args) {
        SpringApplication.run(BusinessApplication.class, args);
    }

    @FeignClient(name = "storage-service", url = "http://localhost:4002")
    public interface StorageService {

        @GetMapping(path = "/storage/insert")
        String storage();

    }

    @FeignClient(name = "order-service", url = "http://localhost:4001")
    public interface OrderService {

        @GetMapping(path = "/order/insert")
        String order();

    }

}
